package vo;

import constant.Constant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult implements Serializable {
    private String code;
    private String name;
    private Object data;


    public static AjaxResult success(){
        return success("OK");
    }

    public static AjaxResult success(String name){
        return success(name,null);
    }

    public static AjaxResult success(String name,Object data){
        return new AjaxResult(Constant.AjaxCode.AJAX_CODE_SUCCESS,name,data);
    }
}
